package com.git.demo.gateway.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import java.util.HashMap;
import java.util.Map;

@RestController
public class NoFoundController {

    @RequestMapping(value = "/fallback")
    public Mono<Map<String,String>> fallback(){
        Map<String,String> stringMap = new HashMap<>();
        stringMap.put("code","100");
        stringMap.put("data","服务不可用");
        return Mono.just(stringMap);
    }

    @RequestMapping(value = "/notfound")
    public Mono<Map<String,String>> notFound(){
        Map<String,String> stringMap = new HashMap<>();
        stringMap.put("code","404");
        stringMap.put("data","无资源");
        return Mono.just(stringMap);
    }
}
